#ifndef  _MFG_COORD_H
#define  _MFG_COORD_H

/* INCLUDE */
#include "ZDApp.h"
#include "../mfg.h"

/* MACRO */
#define NODE_NONE       0x00
#define NODE_ROUTER     0x01
#define NODE_ENDDEV     0x02

#define  NODE_ST_TC     0x00
#define  NODE_ST_ANNCE  0x01
#define  NODE_ST_EP     0x02

#define  EP_STA_NEW        0
#define  EP_STA_START      1

#ifndef  COORD_JOINING_LIMIT
#define  COORD_JOINING_LIMIT   3
#endif

/* typdef */
typedef struct
{
    uint16 clusterId;
    uint8  cmdId;
}mfgServerCmd_t;

/* function */
extern ZStatus_t MFG_ZclPluginCallback( zclIncoming_t *pInMsg );
extern bool MFG_WhiteListAdd(uint8 *mac);
extern bool MFG_WhiteListCheck(uint8 *mac);
extern bool MFG_WhiteListEnable(void);
extern void MFG_WhiteListSet(uint8 enable);
//stack indication
void MFG_LeaveInd(NLME_LeaveInd_t *pInd);
void MFG_TcJoinInd(ZDO_TC_Device_t *pInd);
void MFG_DeviceAnnounceInd(ZDO_DeviceAnnce_t ind);
void MFG_VerifyLinkKey(bdb_TCLinkKeyExchProcess_t ind);
bool MFG_ActiveEpInd(ZDO_ActiveEndpointRsp_t* pRsp);
bool MFG_SimpleDescInd(ZDO_SimpleDescRsp_t rsp);
bool MFG_MatchSeverCmd(uint16 clusterID, uint8 cmdID);

ZStatus_t mfgDeviceValidateCallback( uint16 nwkAddr, uint8* extAddr, uint16 parentAddr );
void mfgDeviceLeaveNotifyCallback( uint16 nwkAddr, uint8 *extAddr, uint16 parentAddr );
void MFG_processZDOMgs(zdoIncomingMsg_t* pMsg);

extern void MFG_InitCallback(uint8 taskId);
extern void MFG_PeriodCallback(void);

extern void MFG_RandomExtPanid(void);

//zdp rsp

#endif